<style lang="less" scoped>
.panel {
  background: white;
  margin-top: 10px;
  &-item {
    border-bottom: 0.1px solid #eaeaea;
  }
  &-title {
    display: flex;
    padding: 10px;
    border-bottom: 0.1px solid #eaeaea;
    &__label {
      flex: 1;
      font-size: 16px;
      align-items: center;
    }
  }
  &-content {
    padding-bottom: 10px;
    &__item {
      display: flex;
      padding: 10px 10px 0 10px;
      font-size: 14px;
      &-label {
        color: #666;
      }
      &-value {
        flex: 1;
        padding-left: 15px;
        color: #333;
      }
      &-right {
        min-width: 80px;
        text-align: right;
      }
    }
    &__change {
      background: #f8f8f8;
      flex: 1;
      max-width: 100%;
      display: flex;
      color: #666;
      word-wrap: break-word;
      word-break: break-all;
      font-size: 12px;
      &-before {
        flex: 1;
        padding: 4px;
      }
      &-after {
        flex: 1;
        padding: 4px;
      }
    }
  }
}
</style>
<style lang="less">
em {
  color: red !important;
}
</style>

<template>

  <div class="panel">
    <template v-for="(item1, index1) in item" wx:key="unique">
      <section :key="index1" class="panel-item">
        <div class="panel-title" v-if="item1.left">
          <div class="panel-title__label">{{item1.left}}</div>
          <div class="panel-title__right">{{item1.right}}</div>
        </div>

        <div class="panel-content">
          <div class="panel-content__item" v-for="(item2,index2) in item1.children" :key="index2">
            <template v-if="item2.change">
              <!-- 记录变更 -->
              <div class="panel-content__change">
                <div class="panel-content__change-before">
                  <template v-for="(item3, index3) in item2.change.before" wx:key="unique">
                    <!-- <div :key="index3" v-html="item3"></div> -->
                    <change-item :item="item3" :key="index3"></change-item>
                  </template>
                </div>
                <div class="panel-content__change-after">
                  <template v-for="(item4, index4) in item2.change.after" wx:key="unique">
                    <!-- <div :key="index4" v-html="item4"></div> -->
                    <change-item :item="item4" :key="index4"></change-item>
                  </template>
                </div>
              </div>
            </template>
            <template v-else>
              <div class="panel-content__item-label" v-html="item2.left"></div>
              <div class="panel-content__item-value">{{item2.content}}</div>
              <div class="panel-content__item-right">{{item2.right}}</div>
            </template>
          </div>
        </div>
      </section>

    </template>

  </div>

</template>
<script>
import ChangeItem from './changeItem';
export default {
  components: { ChangeItem },
  props: ['item'],
  data() {
    return {};
  },
  methods: {}
};
</script>
